package com.miao.controller;

import com.miao.dto.CoursePreviewDto;
import com.miao.service.ICourseBaseService;
import com.miao.service.ICoursePublishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/content/open")
public class CourseOpenController {

    @Autowired
    private ICoursePublishService coursePublishService;

    //播放视频时候根据id查询课程信息
    //http://www.51xuecheng.cn/open/content/course/whole/148
    //http://localhost:63010/content/open/course/whole/148
    @GetMapping("/course/whole/{courseId}")
    public CoursePreviewDto getPreview(@PathVariable Long courseId){
        return coursePublishService.getCoursePreview(courseId);
    }


}
